<?php

namespace Admin\Model;
use Think\Model;

/**
 * Class SystemModel
 * @package Admin\Model
 *商城配置
 */
class SystemModel  extends Model
{
    /**
     * @param mixed|string $data
     * 配置修改
     */
    public function add($data){
        $data['svalue'][3]=$data['logo'];
        foreach($data['svalue'] as $k=>$v){
            $k=$k+1;
          if(notNull($v)){
              $sname=$this->where("id=$k")->getField('sname');
              return ['valid'=>0,'msg'=>"{$sname}不能为空"];
          }
            $this->where("id=$k")->setField('svalue',$v);
        }
        return ['valid'=>1,'msg'=>"修改成功"];
    }
}